<?php

abstract class Model
{
	
	protected $already_saved ;
	protected $modified ;
	protected $data ;
	protected $db ;
	
	public static function getById ( $id ) { }
	public static function getBy ( $condition ) { }
	
	public function __construct ( $params = null, $already_saved = false )
	{
		
		$config = require './config/db_config.php' ;
		$this->db = &db::getInstance ( $config ) ;
		$this->already_saved = (bool) $already_saved ;
		$this->modified = false ;
		if ( is_array ( $params ) )
			$this->data = $params ;
		else
			$this->data = array ( ) ;
		
	}
	
	public function save ( ) { }
	public function delete ( ) { }
	
}

?>